use actix_web::{HttpResponse, web};
use crate::states::AppState;

pub async fn health_check_handler(app_state: web::Data<AppState>) -> HttpResponse {
    let health = &app_state.health_check_response;

    let mut visit_ount = app_state.visit_count.lock().unwrap();

    *visit_ount += 1;


    let response = format!("{}{} times", health, visit_ount);


    HttpResponse::Ok().json(response)
}